<!--
 * @Author: Xujianchen
 * @Date: 2024-11-01 09:48:57
 * @LastEditors: Xujianchen
 * @LastEditTime: 2025-01-21 10:09:12
 * @Description: 
-->
<template>
  <Wrapper>
    <el-button type="primary" @click="getValue">获取值</el-button>
    <el-card header="路由传参：刷新不丢失数据" shadow="never">
      <json-editor
        v-model="data"
        :deep="8"
        :show-icon="true"
        :show-line-number="true"
        :editable="true"
      />
    </el-card>
  </Wrapper>
</template>

<script setup>
import { ElMessage } from 'element-plus'
import JsonEditor from '@/components/json-editor'

const data = ref(JSON.parse(decodeURIComponent(useRoute().query.item)))

function getValue() {
  ElMessage.success('打开控制台查看')
  console.log(data.value)
}
</script>
